
package system.base;

import framework.core.*;
import system.SelectManager;
import system.data.*;

/*
	Author    :chengbiao.he
	CreateTime:2008-02-22 10:35:17
*/
public class ServerDownupfileInfo extends ServerDownupfileInfoBase 
{
    public final static String DOWNLOADTYPE_DOWN = "下载";
    public final static String DOWNLOADTYPE_UP = "上传";
    
    public final static String UPLOAD_PARMSTYPE_TEXT ="TEXT";
    public final static String UPLOAD_STATE_SUCCESS = "成功";
    public final static String UPLOAD_STATE_FAIL = "失败";
    
//----system generated start----// 	
public ServerDownupfileInfo() 
{
	
}

private static void delete(DBConnection con,String id) throws Exception
{
	Conditions conditions = new Conditions();

	conditions.add(ID,id);
	
	delete(con,TABLE_NAME,conditions);
}
public static ServerDownupfileInfo fetch()
{
	return new ServerDownupfileInfo();
}
public static ServerDownupfileInfo copy(ServerDownupfileInfo srcObj)
{
	ServerDownupfileInfo obj = fetch();
	obj.copyBase(srcObj);
	return obj;
}
public static ServerDownupfileInfo fetch(DBConnection con,String id) throws Exception
{
	Conditions conditions = new Conditions();

	conditions.add(ID,id);
	
	return fetch(con,conditions);
}
public static ServerDownupfileInfo fetch(DBConnection con,Conditions conditions) throws Exception
{
	DBResult result = null;
	try
	{
		result = DBEngine.doSelect(con,"select * from " + TABLE_NAME,conditions);
		java.sql.ResultSet rs = result.getRs();
		ServerDownupfileInfo obj = null;
		if(rs.next())
		{
			obj = fetch(rs);
		}
		return obj;
	}
	finally
	{
		if(result!=null) result.clear() ;
	}
}
public static ServerDownupfileInfo fetch(java.sql.ResultSet rs) throws Exception
{
	ServerDownupfileInfo obj = new ServerDownupfileInfo();
	obj.initObject(rs);
	return obj;
}
protected void getUnique(DBConnection con) throws Exception
{
		setId(DBEngine.getId(con));
}
//----system generated end----//



//----add by chengbiao.he start----//
public String viewWarehouseUincode(DBConnection con) throws Exception
{
    String mReturn = "";
    Conditions cs = new Conditions();
    cs.add(Warehouse.CODE,getWarehouseUincode());
    Warehouse w = Warehouse.fetch(con, cs);
    if (w != null)
        mReturn = w.viewName(con);
    return mReturn;
}

//----add by chengbiao.he end----//

}

